Skip to content

Conversation

afeld
Copy link
Contributor

@afeld afeld commented Jan 28, 2025

This is confusing to my students, so figured it would be helpful to call it out explicitly.

  • closes #xxxx (Replace xxxx with the GitHub issue number)
  • Tests added and passed if fixing a bug or adding a new feature
  • All code checks passed.
  • Added type annotations to new arguments/methods/functions.
  • Added an entry in the latest doc/source/whatsnew/vX.X.X.rst file if fixing a bug or adding a new feature.

df["A"]
If the label only contains letters, numbers, and underscores, you can
alternatively use dot notation:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is "dot notation" the right term?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Get attribute (getattr) notation would be more correct

df["A"]
If the label only contains letters, numbers, and underscores, you can
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mind confirming I have this right?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pandas allows strings that pass isidentifier https://docs.python.org/3/library/stdtypes.html#str.isidentifier

@mroeschke mroeschke added the Docs label Jan 28, 2025
Copy link
Contributor

This pull request is stale because it has been open for thirty days with no activity. Please update and respond to this comment if you're still interested in working on this.

@github-actions github-actions bot added the Stale label Feb 28, 2025
@afeld
Copy link
Contributor Author

afeld commented Mar 3, 2025

I'll pick this back up soon.

@datapythonista datapythonista changed the title expand on different Getitem uses DOC: Expand on different Getitem uses May 21, 2025
@mroeschke mroeschke merged commit 1321954 into pandas-dev:main May 21, 2025
8 checks passed
@mroeschke mroeschke added this to the 3.0 milestone May 21, 2025
@mroeschke
Copy link
Member

Thanks @afeld and @datapythonista

xaris96 pushed a commit to xaris96/pandas that referenced this pull request May 30, 2025
* expand on different Getitem uses

* Update doc/source/user_guide/10min.rst

---------

Co-authored-by: Marc Garcia <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants